Skip to content

🧪 test: Wait for the Reply Tab's Seen Write Before Restoring the Unread Baseline - #17870

Merged
berry-13 merged 1 commit into
devfrom
fix/withheld-replies-seen-race
Nov 6, 2026
Merged

berry-13 merged 1 commit into
devfrom
fix/withheld-replies-seen-race

Conversation

@berry-13

@berry-13 berry-13 commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Pull Request

Summary

unseen-replies.spec.ts:486 (withheld-replies-released-after-grant) failed about half of its runs on dev, and reddened unrelated PRs at random. The scenario sends a reply from a second tab, then restores the unread baseline in Mongo so the first tab's away poll can light the dot. The second tab is focused and acknowledges the reply it just rendered with POST /api/convos/seen, and that write sometimes landed after the restore and overwrote it. The first tab then polled a conversation the server considered read, so the dot could never appear and the 45 second wait timed out.

The sibling scenario reply-finishing-in-another-tab-lights-dot already waits for that acknowledgement before restoring the baseline. This scenario now does the same. Only the test changes; a reply seen in a focused tab is correctly marked seen.

Type of change

  • Tests

Testing

Automated tests:

Screenshots / recordings

No user-facing change.

Risk / compatibility

None: a test-only change.

Checklist

  • I reviewed my own changes
  • Relevant tests have been added or updated
  • Existing relevant tests pass
  • The change does not introduce new warnings or errors

… Baseline

The withheld-reply scenario restored the unread baseline in Mongo right after the reply tab finished, while that tab was still posting its own seen acknowledgement. When the acknowledgement landed second it overwrote the baseline, the first tab polled a conversation the server considered read, and its dot never appeared. The sibling scenario already waits for the acknowledgement; this one now does too.
@berry-13 berry-13 added the 🧪 tests Unit/integration test updates label Nov 6, 2026
Copilot AI balanced review requested due to automatic review settings November 6, 2026 17:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T17:25:45.586865Z 26cbf46 PR opened
🔒 Security Review ✅ Completed 2026-11-06T17:26:53.808136Z 26cbf46 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@berry-13
berry-13 merged commit eb1e3e6 into dev Nov 6, 2026
20 checks passed
@berry-13
berry-13 deleted the fix/withheld-replies-seen-race branch November 6, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧪 tests Unit/integration test updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants